<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="language" content="en" />
        <link href="./assets/ffd55088/css/bootstrap.css" rel="stylesheet">
<link href="./assets/5cf9384a/solarized_light.css" rel="stylesheet">
<link href="./assets/6c54116e/style.css" rel="stylesheet">
<script src="./assets/a44cef0f/jquery.js"></script>
<script src="./assets/ffd55088/js/bootstrap.js"></script>
<script src="./assets/8ac4e28a/jssearch.js"></script>    <title>Session, yii\mongodb\Session - Yii Framework 2.0 API Documentation</title>
</head>
<body>

<div class="wrap">
    <nav id="w11969" class="navbar-inverse navbar-fixed-top navbar" role="navigation"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#w11969-collapse"><span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span></button><a class="navbar-brand" href="./index.html">Yii Framework 2.0 API Documentation</a></div><div id="w11969-collapse" class="collapse navbar-collapse"><ul id="w11970" class="navbar-nav nav"><li><a href="./index.html">Class reference</a></li>
<li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown">Extensions <b class="caret"></b></a><ul id="w11971" class="dropdown-menu"><li><a href="./ext-apidoc-index.html" tabindex="-1">apidoc</a></li>
<li><a href="./ext-authclient-index.html" tabindex="-1">authclient</a></li>
<li><a href="./ext-bootstrap-index.html" tabindex="-1">bootstrap</a></li>
<li><a href="./ext-codeception-index.html" tabindex="-1">codeception</a></li>
<li><a href="./ext-debug-index.html" tabindex="-1">debug</a></li>
<li><a href="./ext-elasticsearch-index.html" tabindex="-1">elasticsearch</a></li>
<li><a href="./ext-faker-index.html" tabindex="-1">faker</a></li>
<li><a href="./ext-gii-index.html" tabindex="-1">gii</a></li>
<li><a href="./ext-imagine-index.html" tabindex="-1">imagine</a></li>
<li><a href="./ext-jui-index.html" tabindex="-1">jui</a></li>
<li><a href="./ext-mongodb-index.html" tabindex="-1">mongodb</a></li>
<li><a href="./ext-redis-index.html" tabindex="-1">redis</a></li>
<li><a href="./ext-smarty-index.html" tabindex="-1">smarty</a></li>
<li><a href="./ext-sphinx-index.html" tabindex="-1">sphinx</a></li>
<li><a href="./ext-swiftmailer-index.html" tabindex="-1">swiftmailer</a></li>
<li><a href="./ext-twig-index.html" tabindex="-1">twig</a></li></ul></li>
<li><a href="./guide-README.html">Guide</a></li></ul><div class="navbar-form navbar-left" role="search">
  <div class="form-group">
    <input id="searchbox" type="text" class="form-control" placeholder="Search">
  </div>
</div>
</div></nav>
    <div id="search-resultbox" style="display: none;" class="modal-content">
        <ul id="search-results">
        </ul>
    </div>

    
<div class="row">
    <div class="col-md-3">
                <div id="navigation" class="list-group"><a class="list-group-item active" href="#navigation-11960" data-toggle="collapse" data-parent="#navigation">yii\mongodb <b class="caret"></b></a><div id="navigation-11960" class="submenu panel-collapse collapse in"><a class="list-group-item" href="./yii-mongodb-activefixture.html">ActiveFixture</a>
<a class="list-group-item" href="./yii-mongodb-activequery.html">ActiveQuery</a>
<a class="list-group-item" href="./yii-mongodb-activerecord.html">ActiveRecord</a>
<a class="list-group-item" href="./yii-mongodb-batchqueryresult.html">BatchQueryResult</a>
<a class="list-group-item" href="./yii-mongodb-cache.html">Cache</a>
<a class="list-group-item" href="./yii-mongodb-collection.html">Collection</a>
<a class="list-group-item" href="./yii-mongodb-command.html">Command</a>
<a class="list-group-item" href="./yii-mongodb-connection.html">Connection</a>
<a class="list-group-item" href="./yii-mongodb-database.html">Database</a>
<a class="list-group-item" href="./yii-mongodb-exception.html">Exception</a>
<a class="list-group-item" href="./yii-mongodb-logbuilder.html">LogBuilder</a>
<a class="list-group-item" href="./yii-mongodb-migration.html">Migration</a>
<a class="list-group-item" href="./yii-mongodb-query.html">Query</a>
<a class="list-group-item" href="./yii-mongodb-querybuilder.html">QueryBuilder</a>
<a class="list-group-item active" href="./yii-mongodb-session.html">Session</a></div>
<a class="list-group-item" href="#navigation-11961" data-toggle="collapse" data-parent="#navigation">yii\mongodb\console\controllers <b class="caret"></b></a><div id="navigation-11961" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-console-controllers-migratecontroller.html">MigrateController</a></div>
<a class="list-group-item" href="#navigation-11962" data-toggle="collapse" data-parent="#navigation">yii\mongodb\debug <b class="caret"></b></a><div id="navigation-11962" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-debug-explainaction.html">ExplainAction</a>
<a class="list-group-item" href="./yii-mongodb-debug-mongodbpanel.html">MongoDbPanel</a></div>
<a class="list-group-item" href="#navigation-11963" data-toggle="collapse" data-parent="#navigation">yii\mongodb\file <b class="caret"></b></a><div id="navigation-11963" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-file-activequery.html">ActiveQuery</a>
<a class="list-group-item" href="./yii-mongodb-file-activerecord.html">ActiveRecord</a>
<a class="list-group-item" href="./yii-mongodb-file-collection.html">Collection</a>
<a class="list-group-item" href="./yii-mongodb-file-cursor.html">Cursor</a>
<a class="list-group-item" href="./yii-mongodb-file-download.html">Download</a>
<a class="list-group-item" href="./yii-mongodb-file-query.html">Query</a>
<a class="list-group-item" href="./yii-mongodb-file-streamwrapper.html">StreamWrapper</a>
<a class="list-group-item" href="./yii-mongodb-file-upload.html">Upload</a></div>
<a class="list-group-item" href="#navigation-11964" data-toggle="collapse" data-parent="#navigation">yii\mongodb\gii\model <b class="caret"></b></a><div id="navigation-11964" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-gii-model-generator.html">Generator</a></div>
<a class="list-group-item" href="#navigation-11965" data-toggle="collapse" data-parent="#navigation">yii\mongodb\i18n <b class="caret"></b></a><div id="navigation-11965" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-i18n-mongodbmessagesource.html">MongoDbMessageSource</a></div>
<a class="list-group-item" href="#navigation-11966" data-toggle="collapse" data-parent="#navigation">yii\mongodb\log <b class="caret"></b></a><div id="navigation-11966" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-log-mongodbtarget.html">MongoDbTarget</a></div>
<a class="list-group-item" href="#navigation-11967" data-toggle="collapse" data-parent="#navigation">yii\mongodb\rbac <b class="caret"></b></a><div id="navigation-11967" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-rbac-mongodbmanager.html">MongoDbManager</a>
<a class="list-group-item" href="./yii-mongodb-rbac-permission.html">Permission</a>
<a class="list-group-item" href="./yii-mongodb-rbac-role.html">Role</a></div>
<a class="list-group-item" href="#navigation-11968" data-toggle="collapse" data-parent="#navigation">yii\mongodb\validators <b class="caret"></b></a><div id="navigation-11968" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-validators-mongodatevalidator.html">MongoDateValidator</a>
<a class="list-group-item" href="./yii-mongodb-validators-mongoidvalidator.html">MongoIdValidator</a></div></div>    </div>
    <div class="col-md-9 api-content" role="main">
        <h1>Class yii\mongodb\Session</h1>
<div class="top-nav">
    <a href="index.html">All Classes</a>
            | <a href="#properties">Properties</a>
                | <a href="#methods">Methods</a>
            </div>

<table class="summaryTable docClass table table-bordered">
    <colgroup>
        <col class="col-name" />
        <col class="col-value" />
    </colgroup>
            <tr><th>Inheritance</th><td><a href="yii-mongodb-session.html">yii\mongodb\Session</a> &raquo;
<a href="yii-web-multifieldsession.html">yii\web\MultiFieldSession</a> &raquo;
<a href="yii-web-session.html">yii\web\Session</a> &raquo;
<a href="yii-base-component.html">yii\base\Component</a> &raquo;
<a href="yii-base-object.html">yii\base\Object</a></td></tr>
                <tr><th>Implements</th><td><a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>, <a href="http://www.php.net/class.countable">Countable</a>, <a href="http://www.php.net/class.iteratoraggregate">IteratorAggregate</a>, <a href="yii-base-configurable.html">yii\base\Configurable</a></td></tr>
                                    <tr><th>Available since version</th><td>2.0</td></tr>
                    <tr>
          <th>Source Code</th>
          <td><a href="https://github.com/yiisoft/yii2-mongodb/blob/master/Session.php">https://github.com/yiisoft/yii2-mongodb/blob/master/Session.php</a></td>
        </tr>
    </table>

<div class="class-description">
    <p><strong>Session extends <a href="yii-web-session.html">yii\web\Session</a> by using MongoDB as session data storage.</strong></p>
    <p>By default, Session stores session data in a collection named 'session' inside the default database.
This collection is better to be pre-created with fields 'id' and 'expire' indexed.
The collection name can be changed by setting <a href="yii-mongodb-session.html#$sessionCollection-detail">$sessionCollection</a>.</p>
<p>The following example shows how you can configure the application to use Session:
Add the following to your application config under <code>components</code>:</p>
<pre><code class="hljs php language-php"><span class="hljs-string">'session'</span> =&gt; [
    <span class="hljs-string">'class'</span> =&gt; <span class="hljs-string">'yii\mongodb\Session'</span>,
    <span class="hljs-comment">// 'db' =&gt; 'mymongodb',</span>
    <span class="hljs-comment">// 'sessionCollection' =&gt; 'my_session',</span>
]
</code></pre>
<p>Session extends <a href="yii-web-multifieldsession.html">yii\web\MultiFieldSession</a>, thus it allows saving extra fields into the <a href="yii-mongodb-session.html#$sessionCollection-detail">$sessionCollection</a>.
Refer to <a href="yii-web-multifieldsession.html">yii\web\MultiFieldSession</a> for more details.</p>
<p>Tip: you can use MongoDB <a href="http://docs.mongodb.org/manual/tutorial/expire-data/">TTL index</a> for the session garbage
collection for performance saving, in this case you should set <a href="yii-web-session.html#$gCProbability-detail">yii\mongodb\Session::$gCProbability</a> to <code>0</code>.</p>

    </div>

<a id="properties"></a>

<div class="summary doc-property">
<h2>Public Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-property" />
    <col class="col-type" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
        <tr class="inherited" id="$allFlashes">
        <td><a href="yii-web-session.html#$allFlashes-detail">$allFlashes</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>Flash messages (key =&gt; message or key =&gt; [message1, message2]).</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$behaviors">
        <td><a href="yii-base-component.html#$behaviors-detail">$behaviors</a></td>
        <td><a href="yii-base-behavior.html">yii\base\Behavior</a>[]</td>
        <td>List of behaviors attached to this component</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="$cookieParams">
        <td><a href="yii-web-session.html#$cookieParams-detail">$cookieParams</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>The session cookie parameters.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$count">
        <td><a href="yii-web-session.html#$count-detail">$count</a></td>
        <td><a href="http://www.php.net/language.types.integer">integer</a></td>
        <td>The number of session variables</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr id="$db">
        <td><a href="yii-mongodb-session.html#$db-detail">$db</a></td>
        <td><a href="yii-mongodb-connection.html">yii\mongodb\Connection</a>|<a href="http://www.php.net/language.types.array">array</a>|<a href="http://www.php.net/language.types.string">string</a></td>
        <td>The MongoDB connection object or the application component ID of the MongoDB connection.</td>
        <td><a href="yii-mongodb-session.html">yii\mongodb\Session</a></td>
    </tr>
            <tr class="inherited" id="$flash">
        <td><a href="yii-web-session.html#$flash-detail">$flash</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>The key identifying the flash message.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$flashParam">
        <td><a href="yii-web-session.html#$flashParam-detail">$flashParam</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>The name of the session variable that stores the flash message data.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$gCProbability">
        <td><a href="yii-web-session.html#$gCProbability-detail">$gCProbability</a></td>
        <td><a href="http://www.php.net/language.types.float">float</a></td>
        <td>The probability (percentage) that the GC (garbage collection) process is started on every session initialization, defaults to 1 meaning 1% chance.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$handler">
        <td><a href="yii-web-session.html#$handler-detail">$handler</a></td>
        <td><a href="http://www.php.net/class.sessionhandlerinterface">SessionHandlerInterface</a>|<a href="http://www.php.net/language.types.array">array</a></td>
        <td>An object implementing the SessionHandlerInterface or a configuration array.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$hasSessionId">
        <td><a href="yii-web-session.html#$hasSessionId-detail">$hasSessionId</a></td>
        <td><a href="http://www.php.net/language.types.boolean">boolean</a></td>
        <td>Whether the current request has sent the session ID.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$id">
        <td><a href="yii-web-session.html#$id-detail">$id</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>The current session ID</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$isActive">
        <td><a href="yii-web-session.html#$isActive-detail">$isActive</a></td>
        <td><a href="http://www.php.net/language.types.boolean">boolean</a></td>
        <td>Whether the session has started</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$iterator">
        <td><a href="yii-web-session.html#$iterator-detail">$iterator</a></td>
        <td><a href="yii-web-sessioniterator.html">yii\web\SessionIterator</a></td>
        <td>An iterator for traversing the session variables.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$name">
        <td><a href="yii-web-session.html#$name-detail">$name</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>The current session name</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$readCallback">
        <td><a href="yii-web-multifieldsession.html#$readCallback-detail">$readCallback</a></td>
        <td><a href="http://www.php.net/language.types.callable">callable</a></td>
        <td>A callback that will be called during session data reading.</td>
        <td><a href="yii-web-multifieldsession.html">yii\web\MultiFieldSession</a></td>
    </tr>
            <tr class="inherited" id="$savePath">
        <td><a href="yii-web-session.html#$savePath-detail">$savePath</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>The current session save path, defaults to '/tmp'.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr id="$sessionCollection">
        <td><a href="yii-mongodb-session.html#$sessionCollection-detail">$sessionCollection</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></td>
        <td>The name of the MongoDB collection that stores the session data.</td>
        <td><a href="yii-mongodb-session.html">yii\mongodb\Session</a></td>
    </tr>
            <tr class="inherited" id="$timeout">
        <td><a href="yii-web-session.html#$timeout-detail">$timeout</a></td>
        <td><a href="http://www.php.net/language.types.integer">integer</a></td>
        <td>The number of seconds after which data will be seen as 'garbage' and cleaned up.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$useCookies">
        <td><a href="yii-web-session.html#$useCookies-detail">$useCookies</a></td>
        <td><a href="http://www.php.net/language.types.boolean">boolean</a>|<a href="http://www.php.net/language.types.null">null</a></td>
        <td>The value indicating whether cookies should be used to store session IDs.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$useCustomStorage">
        <td><a href="yii-web-multifieldsession.html#$useCustomStorage-detail">$useCustomStorage</a></td>
        <td><a href="http://www.php.net/language.types.boolean">boolean</a></td>
        <td>Whether to use custom storage.</td>
        <td><a href="yii-web-multifieldsession.html">yii\web\MultiFieldSession</a></td>
    </tr>
            <tr class="inherited" id="$useTransparentSessionID">
        <td><a href="yii-web-session.html#$useTransparentSessionID-detail">$useTransparentSessionID</a></td>
        <td><a href="http://www.php.net/language.types.boolean">boolean</a></td>
        <td>Whether transparent sid support is enabled or not, defaults to false.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="$writeCallback">
        <td><a href="yii-web-multifieldsession.html#$writeCallback-detail">$writeCallback</a></td>
        <td><a href="http://www.php.net/language.types.callable">callable</a></td>
        <td>A callback that will be called during session data writing.</td>
        <td><a href="yii-web-multifieldsession.html">yii\web\MultiFieldSession</a></td>
    </tr>
    </table>
</div>

<a id="methods"></a>

<div class="summary doc-method">
<h2>Public Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
        <tr class="inherited" id="__call()">
        <td><a href="yii-base-component.html#__call()-detail">__call()</a></td>
        <td>Calls the named method which is not a class method.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__clone()">
        <td><a href="yii-base-component.html#__clone()-detail">__clone()</a></td>
        <td>This method is called after the object is created by cloning an existing one.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__construct()">
        <td><a href="yii-base-object.html#__construct()-detail">__construct()</a></td>
        <td>Constructor.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__get()">
        <td><a href="yii-base-component.html#__get()-detail">__get()</a></td>
        <td>Returns the value of a component property.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__isset()">
        <td><a href="yii-base-component.html#__isset()-detail">__isset()</a></td>
        <td>Checks if a property is set, i.e. defined and not null.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__set()">
        <td><a href="yii-base-component.html#__set()-detail">__set()</a></td>
        <td>Sets the value of a component property.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__unset()">
        <td><a href="yii-base-component.html#__unset()-detail">__unset()</a></td>
        <td>Sets a component property to be null.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="addFlash()">
        <td><a href="yii-web-session.html#addFlash()-detail">addFlash()</a></td>
        <td>Adds a flash message.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="attachBehavior()">
        <td><a href="yii-base-component.html#attachBehavior()-detail">attachBehavior()</a></td>
        <td>Attaches a behavior to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="attachBehaviors()">
        <td><a href="yii-base-component.html#attachBehaviors()-detail">attachBehaviors()</a></td>
        <td>Attaches a list of behaviors to the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="behaviors()">
        <td><a href="yii-base-component.html#behaviors()-detail">behaviors()</a></td>
        <td>Returns a list of behaviors that this component should behave as.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="canGetProperty()">
        <td><a href="yii-base-component.html#canGetProperty()-detail">canGetProperty()</a></td>
        <td>Returns a value indicating whether a property can be read.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="canSetProperty()">
        <td><a href="yii-base-component.html#canSetProperty()-detail">canSetProperty()</a></td>
        <td>Returns a value indicating whether a property can be set.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="className()">
        <td><a href="yii-base-object.html#className()-detail">className()</a></td>
        <td>Returns the fully qualified name of this class.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="close()">
        <td><a href="yii-web-session.html#close()-detail">close()</a></td>
        <td>Ends the current session and store session data.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="closeSession()">
        <td><a href="yii-web-session.html#closeSession()-detail">closeSession()</a></td>
        <td>Session close handler.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
                <tr class="inherited" id="count()">
        <td><a href="yii-web-session.html#count()-detail">count()</a></td>
        <td>Returns the number of items in the session.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="destroy()">
        <td><a href="yii-web-session.html#destroy()-detail">destroy()</a></td>
        <td>Frees all session variables and destroys all data registered to a session.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr id="destroySession()">
        <td><a href="yii-mongodb-session.html#destroySession()-detail">destroySession()</a></td>
        <td>Session destroy handler.</td>
        <td><a href="yii-mongodb-session.html">yii\mongodb\Session</a></td>
    </tr>
            <tr class="inherited" id="detachBehavior()">
        <td><a href="yii-base-component.html#detachBehavior()-detail">detachBehavior()</a></td>
        <td>Detaches a behavior from the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="detachBehaviors()">
        <td><a href="yii-base-component.html#detachBehaviors()-detail">detachBehaviors()</a></td>
        <td>Detaches all behaviors from the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="ensureBehaviors()">
        <td><a href="yii-base-component.html#ensureBehaviors()-detail">ensureBehaviors()</a></td>
        <td>Makes sure that the behaviors declared in <a href="yii-base-component.html#behaviors()-detail">behaviors()</a> are attached to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
                <tr id="gcSession()">
        <td><a href="yii-mongodb-session.html#gcSession()-detail">gcSession()</a></td>
        <td>Session GC (garbage collection) handler.</td>
        <td><a href="yii-mongodb-session.html">yii\mongodb\Session</a></td>
    </tr>
            <tr class="inherited" id="get()">
        <td><a href="yii-web-session.html#get()-detail">get()</a></td>
        <td>Returns the session variable value with the session variable name.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getAllFlashes()">
        <td><a href="yii-web-session.html#getAllFlashes()-detail">getAllFlashes()</a></td>
        <td>Returns all flash messages.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getBehavior()">
        <td><a href="yii-base-component.html#getBehavior()-detail">getBehavior()</a></td>
        <td>Returns the named behavior object.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="getBehaviors()">
        <td><a href="yii-base-component.html#getBehaviors()-detail">getBehaviors()</a></td>
        <td>Returns all behaviors attached to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="getCookieParams()">
        <td><a href="yii-web-session.html#getCookieParams()-detail">getCookieParams()</a></td>
        <td></td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getCount()">
        <td><a href="yii-web-session.html#getCount()-detail">getCount()</a></td>
        <td>Returns the number of items in the session.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getFlash()">
        <td><a href="yii-web-session.html#getFlash()-detail">getFlash()</a></td>
        <td>Returns a flash message.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getGCProbability()">
        <td><a href="yii-web-session.html#getGCProbability()-detail">getGCProbability()</a></td>
        <td></td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getHasSessionId()">
        <td><a href="yii-web-session.html#getHasSessionId()-detail">getHasSessionId()</a></td>
        <td>Returns a value indicating whether the current request has sent the session ID.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getId()">
        <td><a href="yii-web-session.html#getId()-detail">getId()</a></td>
        <td>Gets the session ID.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getIsActive()">
        <td><a href="yii-web-session.html#getIsActive()-detail">getIsActive()</a></td>
        <td></td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getIterator()">
        <td><a href="yii-web-session.html#getIterator()-detail">getIterator()</a></td>
        <td>Returns an iterator for traversing the session variables.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getName()">
        <td><a href="yii-web-session.html#getName()-detail">getName()</a></td>
        <td>Gets the name of the current session.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getSavePath()">
        <td><a href="yii-web-session.html#getSavePath()-detail">getSavePath()</a></td>
        <td>Gets the current session save path.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getTimeout()">
        <td><a href="yii-web-session.html#getTimeout()-detail">getTimeout()</a></td>
        <td></td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getUseCookies()">
        <td><a href="yii-web-session.html#getUseCookies()-detail">getUseCookies()</a></td>
        <td>Returns the value indicating whether cookies should be used to store session IDs.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="getUseCustomStorage()">
        <td><a href="yii-web-multifieldsession.html#getUseCustomStorage()-detail">getUseCustomStorage()</a></td>
        <td>Returns a value indicating whether to use custom session storage.</td>
        <td><a href="yii-web-multifieldsession.html">yii\web\MultiFieldSession</a></td>
    </tr>
            <tr class="inherited" id="getUseTransparentSessionID()">
        <td><a href="yii-web-session.html#getUseTransparentSessionID()-detail">getUseTransparentSessionID()</a></td>
        <td></td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="has()">
        <td><a href="yii-web-session.html#has()-detail">has()</a></td>
        <td></td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="hasEventHandlers()">
        <td><a href="yii-base-component.html#hasEventHandlers()-detail">hasEventHandlers()</a></td>
        <td>Returns a value indicating whether there is any handler attached to the named event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="hasFlash()">
        <td><a href="yii-web-session.html#hasFlash()-detail">hasFlash()</a></td>
        <td>Returns a value indicating whether there are flash messages associated with the specified key.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="hasMethod()">
        <td><a href="yii-base-component.html#hasMethod()-detail">hasMethod()</a></td>
        <td>Returns a value indicating whether a method is defined.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="hasProperty()">
        <td><a href="yii-base-component.html#hasProperty()-detail">hasProperty()</a></td>
        <td>Returns a value indicating whether a property is defined for this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="init()">
        <td><a href="yii-mongodb-session.html#init()-detail">init()</a></td>
        <td>Initializes the Session component.</td>
        <td><a href="yii-mongodb-session.html">yii\mongodb\Session</a></td>
    </tr>
            <tr class="inherited" id="off()">
        <td><a href="yii-base-component.html#off()-detail">off()</a></td>
        <td>Detaches an existing event handler from this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="offsetExists()">
        <td><a href="yii-web-session.html#offsetExists()-detail">offsetExists()</a></td>
        <td>This method is required by the interface <a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="offsetGet()">
        <td><a href="yii-web-session.html#offsetGet()-detail">offsetGet()</a></td>
        <td>This method is required by the interface <a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="offsetSet()">
        <td><a href="yii-web-session.html#offsetSet()-detail">offsetSet()</a></td>
        <td>This method is required by the interface <a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="offsetUnset()">
        <td><a href="yii-web-session.html#offsetUnset()-detail">offsetUnset()</a></td>
        <td>This method is required by the interface <a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="on()">
        <td><a href="yii-base-component.html#on()-detail">on()</a></td>
        <td>Attaches an event handler to an event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="open()">
        <td><a href="yii-web-session.html#open()-detail">open()</a></td>
        <td>Starts the session.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="openSession()">
        <td><a href="yii-web-session.html#openSession()-detail">openSession()</a></td>
        <td>Session open handler.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr id="readSession()">
        <td><a href="yii-mongodb-session.html#readSession()-detail">readSession()</a></td>
        <td>Session read handler.</td>
        <td><a href="yii-mongodb-session.html">yii\mongodb\Session</a></td>
    </tr>
            <tr id="regenerateID()">
        <td><a href="yii-mongodb-session.html#regenerateID()-detail">regenerateID()</a></td>
        <td>Updates the current session ID with a newly generated one.</td>
        <td><a href="yii-mongodb-session.html">yii\mongodb\Session</a></td>
    </tr>
                <tr class="inherited" id="remove()">
        <td><a href="yii-web-session.html#remove()-detail">remove()</a></td>
        <td>Removes a session variable.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="removeAll()">
        <td><a href="yii-web-session.html#removeAll()-detail">removeAll()</a></td>
        <td>Removes all session variables</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="removeAllFlashes()">
        <td><a href="yii-web-session.html#removeAllFlashes()-detail">removeAllFlashes()</a></td>
        <td>Removes all flash messages.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="removeFlash()">
        <td><a href="yii-web-session.html#removeFlash()-detail">removeFlash()</a></td>
        <td>Removes a flash message.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="set()">
        <td><a href="yii-web-session.html#set()-detail">set()</a></td>
        <td>Adds a session variable.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="setCookieParams()">
        <td><a href="yii-web-session.html#setCookieParams()-detail">setCookieParams()</a></td>
        <td>Sets the session cookie parameters.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="setFlash()">
        <td><a href="yii-web-session.html#setFlash()-detail">setFlash()</a></td>
        <td>Sets a flash message.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="setGCProbability()">
        <td><a href="yii-web-session.html#setGCProbability()-detail">setGCProbability()</a></td>
        <td></td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="setHasSessionId()">
        <td><a href="yii-web-session.html#setHasSessionId()-detail">setHasSessionId()</a></td>
        <td>Sets the value indicating whether the current request has sent the session ID.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="setId()">
        <td><a href="yii-web-session.html#setId()-detail">setId()</a></td>
        <td>Sets the session ID.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="setName()">
        <td><a href="yii-web-session.html#setName()-detail">setName()</a></td>
        <td>Sets the name for the current session.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="setSavePath()">
        <td><a href="yii-web-session.html#setSavePath()-detail">setSavePath()</a></td>
        <td>Sets the current session save path.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="setTimeout()">
        <td><a href="yii-web-session.html#setTimeout()-detail">setTimeout()</a></td>
        <td></td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="setUseCookies()">
        <td><a href="yii-web-session.html#setUseCookies()-detail">setUseCookies()</a></td>
        <td>Sets the value indicating whether cookies should be used to store session IDs.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="setUseTransparentSessionID()">
        <td><a href="yii-web-session.html#setUseTransparentSessionID()-detail">setUseTransparentSessionID()</a></td>
        <td></td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
            <tr class="inherited" id="trigger()">
        <td><a href="yii-base-component.html#trigger()-detail">trigger()</a></td>
        <td>Triggers an event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
                <tr id="writeSession()">
        <td><a href="yii-mongodb-session.html#writeSession()-detail">writeSession()</a></td>
        <td>Session write handler.</td>
        <td><a href="yii-mongodb-session.html">yii\mongodb\Session</a></td>
    </tr>
    </table>
</div>

<div class="summary doc-method">
<h2>Protected Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
                                                                        <tr class="inherited" id="composeFields()">
        <td><a href="yii-web-multifieldsession.html#composeFields()-detail">composeFields()</a></td>
        <td>Composes storage field set for session writing.</td>
        <td><a href="yii-web-multifieldsession.html">yii\web\MultiFieldSession</a></td>
    </tr>
                                    <tr class="inherited" id="extractData()">
        <td><a href="yii-web-multifieldsession.html#extractData()-detail">extractData()</a></td>
        <td>Extracts session data from storage field set.</td>
        <td><a href="yii-web-multifieldsession.html">yii\web\MultiFieldSession</a></td>
    </tr>
                                                                                                                                                        <tr class="inherited" id="registerSessionHandler()">
        <td><a href="yii-web-session.html#registerSessionHandler()-detail">registerSessionHandler()</a></td>
        <td>Registers session handler.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
                                                                            <tr class="inherited" id="updateFlashCounters()">
        <td><a href="yii-web-session.html#updateFlashCounters()-detail">updateFlashCounters()</a></td>
        <td>Updates the counters for flash messages and removes outdated flash messages.</td>
        <td><a href="yii-web-session.html">yii\web\Session</a></td>
    </tr>
        </table>
</div>

<a id="events"></a>

<a id="constants"></a>

<h2>Property Details</h2>

<div class="property-doc">

    <div class="detail-header h3" id="$db-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-session.html#$db-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/Session.php#L51" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/Session.php#L51" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $db        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>The MongoDB connection object or the application component ID of the MongoDB connection.
After the Session object is created, if you want to change this property, you should only assign it
with a MongoDB connection object.
Starting from version 2.0.2, this can also be a configuration array for creating the object.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-mongodb-connection.html">yii\mongodb\Connection</a>|<a href="http://www.php.net/language.types.array">array</a>|<a href="http://www.php.net/language.types.string">string</a></span> <a href="yii-mongodb-session.html#$db-detail">$db</a> <span style="color: #0000BB"></span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'mongodb'</span></div>


    <div class="detail-header h3" id="$sessionCollection-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-session.html#$sessionCollection-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/Session.php#L57" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/Session.php#L57" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $sessionCollection        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>The name of the MongoDB collection that stores the session data.
Please refer to <a href="yii-mongodb-connection.html#getCollection()-detail">yii\mongodb\Connection::getCollection()</a> on how to specify this parameter.
This collection is better to be pre-created with fields 'id' and 'expire' indexed.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a>|<a href="http://www.php.net/language.types.array">array</a></span> <a href="yii-mongodb-session.html#$sessionCollection-detail">$sessionCollection</a> <span style="color: #0000BB"></span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'session'</span></div>

</div>
<h2>Method Details</h2>

<div class="method-doc">

    <div class="detail-header h3" id="destroySession()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-session.html#destroySession()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/Session.php#L165" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/Session.php#L165" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        destroySession()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Session destroy handler.</strong></p>

        <p>Do not call this method directly.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-mongodb-session.html#destroySession()-detail">destroySession</a></strong> ( <span style="color: #0000BB">$id</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$id</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Session ID</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether session is destroyed successfully</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="gcSession()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-session.html#gcSession()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/Session.php#L181" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/Session.php#L181" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        gcSession()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Session GC (garbage collection) handler.</strong></p>

        <p>Do not call this method directly.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-mongodb-session.html#gcSession()-detail">gcSession</a></strong> ( <span style="color: #0000BB">$maxLifetime</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$maxLifetime</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The number of seconds after which data will be seen as 'garbage' and cleaned up.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether session is GCed successfully</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="init()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-session.html#init()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/Session.php#L65" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/Session.php#L65" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        init()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Initializes the Session component.</strong></p>

        <p>This method will initialize the <a href="yii-mongodb-session.html#$db-detail">$db</a> property to make sure it refers to a valid MongoDB connection.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-mongodb-session.html#init()-detail">init</a></strong> ( )</td></tr>
                                                            <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidconfigexception.html">yii\base\InvalidConfigException</a></td>
                  <td class="param-desc-col"><p>if <a href="yii-mongodb-session.html#$db-detail">$db</a> is invalid.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="readSession()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-session.html#readSession()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/Session.php#L110" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/Session.php#L110" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        readSession()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Session read handler.</strong></p>

        <p>Do not call this method directly.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-mongodb-session.html#readSession()-detail">readSession</a></strong> ( <span style="color: #0000BB">$id</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$id</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Session ID</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The session data</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="regenerateID()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-session.html#regenerateID()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/Session.php#L76" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/Session.php#L76" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        regenerateID()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Updates the current session ID with a newly generated one.</strong></p>

        <p>Please refer to <a href="http://php.net/session_regenerate_id">http://php.net/session_regenerate_id</a> for more details.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-mongodb-session.html#regenerateID()-detail">regenerateID</a></strong> ( <span style="color: #0000BB">$deleteOldSession&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$deleteOldSession</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to delete the old associated session file or not.</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="writeSession()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-session.html#writeSession()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/Session.php#L137" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/Session.php#L137" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        writeSession()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Session write handler.</strong></p>

        <p>Do not call this method directly.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-mongodb-session.html#writeSession()-detail">writeSession</a></strong> ( <span style="color: #0000BB">$id</span>, <span style="color: #0000BB">$data</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$id</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Session ID</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$data</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Session data</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether session write is successful</p>
</td>
                </tr>
                                    </table>

<!--	-->
</div>
        </div>
</div>

<script type="text/javascript">
    /*<![CDATA[*/
    $("a.toggle").on('click', function () {
        var $this = $(this);
        if ($this.hasClass('properties-hidden')) {
            $this.text($this.text().replace(/Show/,'Hide'));
            $this.parents(".summary").find(".inherited").show();
            $this.removeClass('properties-hidden');
        } else {
            $this.text($this.text().replace(/Hide/,'Show'));
            $this.parents(".summary").find(".inherited").hide();
            $this.addClass('properties-hidden');
        }

        return false;
    });
    /*
     $(".sourceCode a.show").toggle(function () {
     $(this).text($(this).text().replace(/show/,'hide'));
     $(this).parents(".sourceCode").find("div.code").show();
     },function () {
     $(this).text($(this).text().replace(/hide/,'show'));
     $(this).parents(".sourceCode").find("div.code").hide();
     });
     $("a.sourceLink").click(function () {
     $(this).attr('target','_blank');
     });
     */
    /*]]>*/
</script>


</div>

<footer class="footer">
        <p class="pull-right"><small>Page generated on Sat, 09 Jul 2016 12:15:57 +0000</small></p>
    Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a></footer>

<script type="text/javascript">jQuery(document).ready(function () {
    var shiftWindow = function () { scrollBy(0, -50) };
    if (location.hash) setTimeout(shiftWindow, 1);
    window.addEventListener("hashchange", shiftWindow);
var element = document.createElement("script");
element.src = "./jssearch.index.js";
document.body.appendChild(element);

var searchBox = $('#searchbox');

// search when typing in search field
searchBox.on("keyup", function(event) {
    var query = $(this).val();

    if (query == '' || event.which == 27) {
        $('#search-resultbox').hide();
        return;
    } else if (event.which == 13) {
        var selectedLink = $('#search-resultbox a.selected');
        if (selectedLink.length != 0) {
            document.location = selectedLink.attr('href');
            return;
        }
    } else if (event.which == 38 || event.which == 40) {
        $('#search-resultbox').show();

        var selected = $('#search-resultbox a.selected');
        if (selected.length == 0) {
            $('#search-results').find('a').first().addClass('selected');
        } else {
            var next;
            if (event.which == 40) {
                next = selected.parent().next().find('a').first();
            } else {
                next = selected.parent().prev().find('a').first();
            }
            if (next.length != 0) {
                var resultbox = $('#search-results');
                var position = next.position();

//              TODO scrolling is buggy and jumps around
//                resultbox.scrollTop(Math.floor(position.top));
//                console.log(position.top);

                selected.removeClass('selected');
                next.addClass('selected');
            }
        }

        return;
    }
    $('#search-resultbox').show();
    $('#search-results').html('<li><span class="no-results">No results</span></li>');

    var result = jssearch.search(query);

    if (result.length > 0) {
        var i = 0;
        var resHtml = '';

        for (var key in result) {
            if (i++ > 20) {
                break;
            }
            resHtml = resHtml +
            '<li><a href="' + result[key].file.u.substr(3) +'"><span class="title">' + result[key].file.t + '</span>' +
            '<span class="description">' + result[key].file.d + '</span></a></li>';
        }
        $('#search-results').html(resHtml);
    }
});

// hide the search results on ESC
$(document).on("keyup", function(event) { if (event.which == 27) { $('#search-resultbox').hide(); } });
// hide search results on click to document
$(document).bind('click', function (e) { $('#search-resultbox').hide(); });
// except the following:
searchBox.bind('click', function(e) { e.stopPropagation(); });
$('#search-resultbox').bind('click', function(e) { e.stopPropagation(); });

});</script></body>
</html>
